/*
 *--------------------------------------------------------------------------
 *   Battlefield - A Realtime Network Multiplayer Game
 *   =======================================================
 *   Developed by Group D02 - 2009/2010 Semester 4 - CS2103
 *     Harry Nguyen Duy Hoang <nnduyhoang@yahoo.co.uk>
 *     Kent Chng Siang Rong <fivefootway@gmail.com>
 *     Lim Yong Peng <limpeng1986@gmail.com>
 *     Loh Xiankun <u0807185@nus.edu.sg>
 *   Instructed by
 *     Dr. Damith C.Rajapakse <damith@gmail.com>
 *   =======================================================
 *   $Id: MapChooserButton.java 566 2010-07-25 20:55:33Z Harry $
 *   $LastChangedDate: 2010-07-25 20:55:33 +0000 (Sun, 25 Jul 2010) $
 *   $LastChangedBy: Harry $
 *--------------------------------------------------------------------------
 */
package battlefield.ui.component;

import battlefield.resource.Graphics;
import java.awt.Dimension;
import javax.swing.ImageIcon;

/**
 *
 * @author Harry Nguyen
 */
public class MapChooserButton extends GameToggleButton {

    public static final int WIDTH = 128;
    public static final int HEIGHT = 128;
    public static final int MAP_WIDTH = 110;
    public static final int MAP_HEIGHT = 110;
    private String mapName;

    public MapChooserButton(String name) {
        this.mapName = name;
        this.setIcon(new ImageIcon(Graphics.get(name, MAP_WIDTH, MAP_HEIGHT).getImage()));
        this.setNormalImage(Graphics.BUTTON_SQUARE_NORMAL.resize(WIDTH, HEIGHT).getImage());
        this.setHoverImage(Graphics.BUTTON_SQUARE_HOVER.resize(WIDTH, HEIGHT).getImage());
        this.setPreferredSize(new Dimension(WIDTH, HEIGHT));
    }

    public String getMapName() {
        return mapName;
    }
}
